import request from './request' // 你项目中封装的 axios 实例

export const getProducts = () => {
  return request.get('/products')
}

export const createProduct = (data) => {
  return request.post('/products', data)
}

export const updateProduct = (data) => {
  return request.put(`/products/${data.id}`, data)
}

export const deleteProductById = (id) => {
  return request.delete(`/products/${id}`)
}
